package com.lins.framework.ui.home.product;

import com.lins.framework.http.HttpResult;
import com.lins.framework.http.util.Networks;
import com.lins.framework.mvpframe.rx.RxSchedulerHelper;

import java.util.ArrayList;

import rx.Observable;

/**
 * Created by Admin on 2017/3/14.
 */

public class ProductListModel implements ProductListContract.Model {

    @Override
    public Observable<HttpResult<ProductListBean>> getProductList(int catid) {
        return Networks.getInstance()
                .getMApi()
                .getProductList(catid)
                .compose(RxSchedulerHelper.<HttpResult<ProductListBean>>io_main());
    }

    @Override
    public Observable<HttpResult<ArrayList<TopBannerBean>>> getTopBanner(int catid) {
        return Networks.getInstance()
                .getMApi()
                .getTopBanner(catid)
                .compose(RxSchedulerHelper.<HttpResult<ArrayList<TopBannerBean>>>io_main());
    }
}
